<template>
	<div>
		<!-- 用户协议 -->
		<div class="protocol"><u-parse :html="protocolDetail.content"></u-parse></div>
	</div>
</template>

<script>
export default {
	name: 'protocol',
	data() {
		return {
			id: '', //	1=用户协议，2=隐私政策，3=关于我们，4=联系平台
			name: '',
			protocolDetail: {}
		};
	},
	onLoad(options) {
		this.name = options.name;
		this.id = options.id;
		uni.setNavigationBarTitle({
			title: this.name
		});
		this.getProtocolDetail();
	},
	onShow() {},
	methods: {
		getProtocolDetail() {
			this.$u.api.article_detail({ id: this.id }).then(res => {
				this.protocolDetail = res.data;
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.protocol {
	margin: 20rpx;

	.title {
		text-align: center;
	}
}
</style>
